home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / SetShade < prev    next >
Text File  |  1995-07-08  |  685b  |  26 lines

  1. #include "DeskLib:Wimp.h"
  2. #include "DeskLib:WimpSWIs.h"
  3. #include "DeskLib:Icon.h"
  4.  
  5. extern void Icon_SetShade(window_handle window, icon_handle icon, int flag)
  6. /* If flag == 0, (and the icon is currently shaded) it will be un-shaded
  7.  * If flag == 1, (and the icon is currently not shaded) it will be shaded
  8.  */
  9. {
  10.   icon_block istate;
  11.  
  12.   Wimp_GetIconState(window, icon, &istate);
  13.   if (flag)
  14.   {
  15.     if (!istate.flags.data.shaded)
  16.       Wimp_SetIconState(window, icon, icon_SHADED, icon_SHADED);
  17.  
  18.     Icon_LoseCaret(window, icon);    /* Lose the caret if it is in this icon */
  19.   }
  20.   else
  21.   {
  22.     if (istate.flags.data.shaded)
  23.       Wimp_SetIconState(window, icon, 0, icon_SHADED);
  24.   }
  25. }
  26.